﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Bike.Repository;
using Bike.Repository.Models;

namespace Bike.Biz
{
    public class CustomerService : BikeService<Customer>
    {
        public IEnumerable<Customer> GetCustomer(CustomerTypes type)
        {
            IEnumerable<Customer> query;
            var context = ContextManager.GetInstance();
            var contextAdapter = new ObjectContextAdapter(context);
            var unitOfWork = new UnitOfWork(contextAdapter);
            var repository = new CustomerRepository(contextAdapter);

            try
            {
                query = repository.GetCustomer(type);
            }
            catch (Exception ex)
            {

                throw ex;
            }
            return query;
        }
    }
}
